package org.example.http;

import java.io.IOException;

/**
 * @author lilei
 * @date 2020-04-06
 */
public abstract class BServlet {
    public void service(BRequest request, BResponse response) throws IOException {
        if ("GET".equalsIgnoreCase(request.getMethod())) {
            doGet(request, response);
        } else {
            doPost(request, response);
        }
    }

    protected abstract void doPost(BRequest request, BResponse response)throws IOException;

    protected abstract void doGet(BRequest request, BResponse response)throws IOException;
}

